<%@ page language="java"
	import="java.util.*,com.stone.sys.pojo.*"
	pageEncoding="UTF-8"%>
<%@ include file="/jsp/common/common.jsp"%>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
	TUser loginUser  = (TUser)session.getAttribute(IConstant.SESSION_TUSER);//系统当前登录用户
	String roles = (String) session.getAttribute(IConstant.SESSION_ROLES);
%>
<html>
	<head>
		<title>周计划</title>
		<script type="text/javascript" src="<%=contextPath%>/js/validator.js"></script>
		<script type="text/javascript"
			src="<%=contextPath%>/js/My97DatePicker/WdatePicker.js"></script>
		<script type="text/javascript"
			src="<%=contextPath%>/js/jquery.autogrow.js"></script>
		<script type="text/javascript">
			$(document).ready (function() {
		
			$('textarea').autogrow();		
			});
			Ext.onReady(function(){
				var tb = new Ext.Toolbar({
			   		renderTo: document.all.tbar,
			    	items: [
						{
				            text: '提交',
				            icon:"<%=contextPath%>/" + "images/editlink.gif",
			                handler:function(){
				            	comt();
				            }
				        },'-',
				        {
				            text: '返回',
				            icon:"<%=contextPath%>/images/fanhui.png",
				            handler:function(){
				            	back();
				            }
				        }
			    	]
			    });
			});
			
		</script>
	</head>

	<body topmargin="0">
		<div id="tbar" style="position: absolute; display: block left :   0px; top: 0px; width: 100%; height: 35px; z-index: 1;"></div>
		<br>
		<div id="Layer" style="position: absolute; display: block left :   0px; top: 35px; width: 100%; height: 94%; z-index: 1000; overflow: auto;">
		<center>
				<!-- 信息提示 -->
				<div id="result">
					<font color="red">${info }</font>
				</div>
		</center>
		<c:if test="${entity.id == 0 }">
		<form id="frmM" class="ct" name="frmM" method="POST" enctype="multipart/form-data" action="<%=contextPath%>/weekplan!addWeekplan.do">
			<s:hidden name="entity.id" />
			<s:hidden name="entity.organid" />
			<s:hidden name="entity.organname" />
			<s:hidden name="entity.tbr" />
			<s:hidden name="entity.tbrq" />
			<s:hidden name="entity.ny" />
			<s:hidden name="entity.weeknum" />
			<table width="80%" border="0" id="infotab">
				<tr>
					<th width="20">当前部门</th>
					<td><c:out value="${entity.organname}"/></td>
					<th width="20">填报人</th>
					<td><c:out value="${entity.tbr}"/></td>
					<th width="20">填报日期</th>
					<td nowrap><s:date name="entity.tbrq" format="yyyy-MM-dd" /></td>
				</tr>
				<tr>
					<th width="20">备注</th>
					<td colspan="5">
						<textarea name="entity.bz" style="width:99%; height: 60px; min-height: 20px;line-height:15pt" min="0" datatype="LimitB"  min="1"   max="2000"  datatype="Require"  msg="审批意见必须输入。且不超过一千个汉字。" ></textarea>
					</td>
				</tr>
				<tr>
					<th>周计划</th>
					<td colspan="5"><s:file id="myFile1" name="myFile1" size="80"></s:file></td>
				</tr>
			</table>
		</form>
		</c:if>
		<c:if test="${entity.id > 0 }">
			<table width="80%" border="0" id="infotab">
				<tr>
					<th width="20">当前部门</th>
					<td><c:out value="${entity.organname}"/></td>
					<th width="20">填报人</th>
					<td><c:out value="${entity.tbr}"/></td>
					<th width="20">填报日期</th>
					<td nowrap><s:date name="entity.tbrq" format="yyyy-MM-dd" /></td>
				</tr>
				<tr>
					<th width="20">备注</th>
					<td colspan="5">
						<c:out value="${entity.bz}"/>
					</td>
				</tr>
			</table>
		</c:if>
		<br/><br/>
		<c:if test="${xsbFileList != null && fn:length(xsbFileList) > 0 }">
			<table width="80%" border="0" id="infotab">
			<th>附件列表</th>
			<c:forEach items="${xsbFileList}" var="xsbFile" varStatus="status">
				<tr>
					<td>
						<a href='<c:out value="${xsbFile.url}"/>' target="_blank"><c:out value="${xsbFile.filename}"/></a>
					</td>
				</tr>
			</c:forEach>
			</table>
		</c:if>
	</div>
</body>
</html>
<script language="javascript">
	 // 保存
     function comt(){
        if(!Validator.Validate(frmM,1)){
			return false;
		}
     	document.frmM.submit();
     }
     
     // 返回
     function back() {
		window.parent.parent.frames["mainFrom"].location.href = "<%=contextPath%>/jsp/business/weekplan/treelistTabBase.jsp?url=weekplanList!getList.do&searchBean.con11=<c:out value="${entity.ny}"/>&searchBean.con12=<c:out value="${entity.weeknum}"/>&countPerPage=100";
     }
</script>
